package org.example.datasource.tablehandler;

import org.example.enums.SubscribeColTypeEnum;
import org.example.model.SubscribeModel;

public abstract class AbstractTableHandler implements TableHandler{
    protected String tableName;
    protected SubscribeColTypeEnum type;
    protected String primaryKey;
    
    public static final TableHandler buildTableHandler(SubscribeModel model) {
    	TableHandler handler = null;
    	switch (SubscribeColTypeEnum.valueOf(model.getColType())) {
		case ALL:
			handler = new IntegratedHandler();
			break;
		case SINGLE:
			handler = new SingleHandler();
			break;
		case MULTIPLE:
			handler = new MultipleHandler();
			break;

		default:
			break;
		}
    	return handler;
    }
}
